﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
	<Style x:Key="TabItemFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle Margin="3,3,3,1" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<!-- リソース ディクショナリのエントリはここで定義します。-->
	<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#F3F3F3" Offset="0"/>
		<GradientStop Color="#EBEBEB" Offset="0.5"/>
		<GradientStop Color="#DDDDDD" Offset="0.5"/>
		<GradientStop Color="#CDCDCD" Offset="1"/>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="TabItemHotBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#EAF6FD" Offset="0.15"/>
		<GradientStop Color="#D9F0FC" Offset=".5"/>
		<GradientStop Color="#BEE6FD" Offset=".5"/>
		<GradientStop Color="#A7D9F5" Offset="1"/>
	</LinearGradientBrush>
	<SolidColorBrush x:Key="TabItemSelectedBackground" Color="#F9F9F9"/>
	<SolidColorBrush x:Key="TabItemHotBorderBrush" Color="#3C7FB1"/>
	<SolidColorBrush x:Key="TabItemDisabledBackground" Color="#F4F4F4"/>
	<SolidColorBrush x:Key="TabItemDisabledBorderBrush" Color="#FFC9C7BA"/>
    <ControlTemplate x:Key="TabItemControlTemplate" TargetType="{x:Type TabItem}">
        <Grid x:Name="grid" SnapsToDevicePixels="true">
            <Grid.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF323232" Offset="0"/>
                    <GradientStop Color="#FF323232" Offset="1"/>
                    <GradientStop Color="#FF1E1E1E" Offset="0.6"/>
                </LinearGradientBrush>
            </Grid.Background>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" Storyboard.TargetName="grid">
                                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="grid">
                                <EasingColorKeyFrame KeyTime="0" Value="#FF323246"/>
                            </ColorAnimationUsingKeyFrames>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="grid">
                                <EasingColorKeyFrame KeyTime="0" Value="#FF1E1E32"/>
                            </ColorAnimationUsingKeyFrames>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="grid">
                                <EasingColorKeyFrame KeyTime="0" Value="#FF323246"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="SelectionStates">
                    <VisualState x:Name="Unselected"/>
                    <VisualState x:Name="Selected">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="selectedCover">
                                <EasingColorKeyFrame KeyTime="0" Value="#FF505050"/>
                            </ColorAnimationUsingKeyFrames>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="selectedCover">
                                <EasingColorKeyFrame KeyTime="0" Value="#FF3C3C3C"/>
                            </ColorAnimationUsingKeyFrames>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="selectedCover">
                                <EasingColorKeyFrame KeyTime="0" Value="#FF505050"/>
                            </ColorAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" Storyboard.TargetName="selectedCover">
                                <EasingDoubleKeyFrame KeyTime="0" Value="0.013"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ValidationStates">
                    <VisualState x:Name="Valid"/>
                    <VisualState x:Name="InvalidFocused"/>
                    <VisualState x:Name="InvalidUnfocused"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="selectedCover">
                <Grid.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#4C000000" Offset="0"/>
                        <GradientStop Color="#4C000000" Offset="1"/>
                        <GradientStop Color="#4C1E1E1E" Offset="0.6"/>
                    </LinearGradientBrush>
                </Grid.Background>
                <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Padding="{TemplateBinding Padding}">
                    <ContentPresenter x:Name="Content" ContentSource="Header" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Bottom" Height="22"/>
                </Border>
            </Grid>
        </Grid>
    </ControlTemplate>

    <Style TargetType="TabItem">
		<Setter Property="FocusVisualStyle" Value="{StaticResource TabItemFocusVisual}"/>
		<Setter Property="Foreground" Value="White"/>
		<Setter Property="Padding" Value="6,1,6,1"/>
		<Setter Property="BorderBrush" Value="{StaticResource TabControlNormalBorderBrush}"/>
		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
		<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
		<Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template" Value="{DynamicResource TabItemControlTemplate}" />
	</Style>
</ResourceDictionary>